<template>
	<view>
		<view style="margin:10rpx;">
			<searchBox :showButton="true" :word="keyword" @blur="getList"></searchBox>
		</view>
		<view style="margin:10rpx;" v-for="(item,index) in list" :key="index">
			<ServiceItem :dataItem="item" />
		</view>
		
	</view>
</template>

<script>
	import searchBox from '@/components/house/tabbar/index/searchBox/search-box.vue';
	import api from '@/providers/API/api.js'
	import requestHttp from '@/providers/essential/httpService.js'
	import ServiceItem from '@/components/accompany/serviceItem/index.vue';
	export default {
		components:{
			searchBox,
			ServiceItem
		},
		data() {
			return {
				list:[],
				keyword:'',
			}
		},
		methods: {
			getList(e){
				console.log(e,'eee')
				if(e){
					this.keyword=e
				}
				if(this.keyword){
					requestHttp.getData(api.getServiceList, {keyword:this.keyword}).then((res) => {
						this.list=res.data.list
					})
				}	
			}
		},
		onLoad(e) {
			if(e.keyword){
				this.keyword=e.keyword
				this.getList()
			}
			
		}
	}
</script>

<style>
page{
	background-color: ghostwhite;
}
</style>